<!-- Custom Style -->
<?php
include "../proses/konek.php";
session_start();
if(!isset($_SESSION['username']))
   {   
  ?><script language="javascript">alert('anda blm login');
document.location='../'</script><?php 
}
else
{
$username = $_SESSION['username'];
$status = $_SESSION['status'];
}
if($status=='Guru')
{
$simpan2=mysql_query("SELECT * FROM  guru where email = '$username' ");
$hasil2=mysql_fetch_assoc($simpan2);
}
else
{
$simpan2=mysql_query("SELECT * FROM  siswa where  email_sis = '$username' ");
$hasil2=mysql_fetch_assoc($simpan2);
}

?>
<html>
<head style='heigh:50px;'>
<title>E-Learning of TetraSMA</title>
	<!-- sidebar css --> 
    <link rel="stylesheet" type="text/css" href="../css/sidebar.css">
    <!-- bootstrap css -->
    <link rel="stylesheet" type="text/css" href="../css/bootstrap/css/bootstrap.css">
	<link rel="stylesheet" type="text/css" href="../css/bootstrap/css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="../css/bootstrap/css/bootstrap-theme.min.css">
	<link rel="stylesheet" type="text/css" href="../css/timeline.css">
	<link rel="stylesheet" type="text/css" href="../css/meisMenu.css">
	<link rel="stylesheet" type="text/css" href="../css/bootstrap/css/profile.css">
	
	<!-- navbar -->
	<script>
var ajaxku;
function ambildata(kls){
 ajaxku = buatajax();
 var url="kelas.php";
 url=url+"?kelas="+kls;
 ajaxku.onreadystatechange=state;
 ajaxku.open("GET",url,true);
 ajaxku.send(null);
}

function ambilguru(mpl){
 ajaxku = buatajax();
 var url="kelas.php";
 url=url+"?mapel="+mpl;
 ajaxku.onreadystatechange=stateGuru;
 ajaxku.open("GET",url,true);
 ajaxku.send(null);
}

function buatajax(){
 if (window.XMLHttpRequest){
 return new XMLHttpRequest();
 }
 if (window.ActiveXObject){
 return new ActiveXObject("Microsoft.XMLHTTP");
 }
 return null;
}
function state(){
var data;
 if (ajaxku.readyState==4){
 data=ajaxku.responseText;
 if(data.length>0){
 document.getElementById("mapel").innerHTML = data
 }else{
 document.getElementById("mapel").innerHTML = '';
 }
 }
}

function stateGuru(){
var data;
 if (ajaxku.readyState==4){
 data=ajaxku.responseText;
 if(data.length>0){
 document.getElementById("guru").innerHTML = data
 }else{
 document.getElementById("guru").innerHTML = '';
 }
 }
}
</script>
<?php	
	require_once('../render.php');
	$render=new render;
	$render->icon();
	$render->navigasi();
	$render->profile($status, $username);
	$render->footer();
?>

</head>

<body style="margin-top:50px;overflow-x:hidden; " class="background">

<!-- menu samping -->

<div id="wrapper" <?php if($status=='siswa'){echo "class='toggled'"; }?>>
	<div id="sidebar-wrapper" >
			<?php
			include ('menuslide.php');
			$menu=new menu;
			$menu->init($username, $status);
			?>
			
	</div>

		<div id="page-content-wrapper">
			<div class="container-fluid">
				<div class="row" style="margin-top:40px">
					<div class="col-xs-11 col-sm-11 col-md-11 col-lg-11">
					<h3><strong>SILAHKAN CARI PELAJARAN YANG ANDA BUTUHKAN</strong></h3>
								<form action="" method="post" class="form-inline">
								<div class="form-group">
								<select size="1" name="kelas" id="kelas" class="form-control" onchange=ambildata(this.value) required />
								<option selected>--Pilih Kelas--</option>
								<?php
								include "pilihan.php";
								?>
								</select>
									
								</div>
								<div class="form-group">
								<select size="1" name="mapel" id="mapel" class="form-control" onchange=ambilguru(this.value) required />
								<option selected>--Pilih MApel--</option>
								
								</select>
									
								</div>
								<div class="form-group">
									
								<select size="1" name="guru" id="guru" class="form-control" required />
								<option selected>--Pilih Guru--</option>
								
								</select>
								</div>
								<div class="form-group">
								<button class="btn btn-success">CARI</button>
								</div>
								</form>
					</div>
	                						
							
				</div>
			</div>
		</div>
</div>

<!-- JQuery Core -->
<script type="text/javascript" src="../js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../css/bootstrap/js/bootstrap.js"></script>
<script type="text/javascript" src="../js/metisMenu.min.js"></script>
<script src="../js/sb-admin-2.js"></script>
<script type="text/javascript" src="../js/sidebar.js"></script>


</body>
</html>

	
